import axiosInstance from "@/api/axiosInstance";
import {objectToQueryParams} from "@/utils";

export const getCoummityRecommendListByRequest = function (data) {
    const datas = objectToQueryParams(data)
    return axiosInstance.get(`/social/community/recommend?${datas}`);
};

export const postApplyGroupByRequest = function (data) {
    return axiosInstance.post(`/social/community/applyJoin`, data);
};

export const getGroupDetailByRequest = function (data) {
    const datas = objectToQueryParams(data)
    return axiosInstance.get(`/social/community/info?${datas}`);
};

export const getGroupMemberListByRequest = function (data) {
    const datas = objectToQueryParams(data)
    return axiosInstance.get(`/social/community/member?${datas}`);
};

export const getWrapProfileCardByRequest = function (data) {
    return axiosInstance.post(`/social/community/requestExchangeCard`, data);
};

export const getCoummunityManagePeddingListByRequest = function (data) {
    const datas = objectToQueryParams(data)
    return axiosInstance.get(`/social/community/manage/pending?${datas}`);
};

export const postApprovalJoinCommunityByRequest = function (data) {
    return axiosInstance.post(`/social/community/manage/approvalJoin`, data);
};


export const postRejectJoinCommunityByRequest = function (data) {
    return axiosInstance.post(`/social/community/manage/rejectJoin`, data);
};


export const getJoinGroupList = function (data) {
    const datas = objectToQueryParams(data)
    return axiosInstance.get(`/social/community/manage/member?${datas}`);
};


export const postKillGroupMember = function (data) {
    return axiosInstance.post(`/social/community/manage/kickOut`, data);
};

export const getCardInfoByRequest = function (data) {
    const datas = objectToQueryParams(data)
    return axiosInstance.get(`/social/community/getCard?${datas}`);
};

export const getSearchCoummunityListByRequest = function (data) {
    const datas = objectToQueryParams(data)
    return axiosInstance.get(`/social/community/search?${datas}`);
};
